---
--类名: TalkEvent.lua
--创建日期: 2015-5-7
--创建人: 陈小虎
--功能描述: 说话事件
--修改内容：
--修改日期:   
--修改人:     
--修改备注: 
--

local Event = import(".Event")

local TalkEvent = class("TalkEvent",function()
    return Event.new()
end)

function TalkEvent:ctor(params)
    self:setEventName(params.event)
 
    self.mNpcId = params.npcId
    self.mContent = L(params.string or "")
    
    self.mTime = params.time or 0

    self.mMaskTouchTime = params.maskTime or self.mTime

    self.mActionName = params.action
    self.mSoundId = params.sound and math.floor(tonumber(params.sound)) or nil
    if params.playEffect then
        local npcConfig = GD:queryMapNpc(self.mNpcId)
        if npcConfig and npcConfig.ID then
            self.mSoundId = tonumber(npcConfig.soundEffect)
        end
    end

    self.mShowType = params.showType
    self.mDelayTime = params.delayTime
    
--    print("TalkEvent:ctor self:getEventName() = ",self:getEventName())
--    print("TalkEvent:ctor self.mNpcId = ",self.mNpcId)
--    print("TalkEvent:ctor self.mContent = ",self.mContent)
end

return TalkEvent